<?php

namespace App\Utils;

use Illuminate\Http\JsonResponse;

class Message
{
    /**
     * 显示消息
     *
     * @param boolean $success
     * @param string $message
     * @param mixed $data
     * @param integer $status
     * @param array $headers
     * @param integer $options
     * @return JsonResponse
     */
    public static function show_message(
        bool $success = false,
        string $message = '未知错误',
        mixed $data = [],
        int $status = 200,
        array $headers = [],
        int $options = 0
    ): JsonResponse {
        return response()->json([
            'success' => $success,
            'message' => $message,
            'data' => $data
        ], $status, $headers, $options);
    }
}
